<style>

</style>
<template>
  <div class="app">
    <div class="a"
         style="margin: auto; margin-top: 20px; border-radius:5px; padding: 20px; width: 80%;  background: #FFFFFF;">
      <div class="form-section">
        <h3>基础信息</h3>
        <el-form ref="form" :model="form" inline label-width="100px">
<!--          <el-form-item label="运单状态">-->
<!--            <el-input v-model="form.isArrived"></el-input>-->
<!--          </el-form-item>-->
          <el-form-item class="input" label="客户" prop="customer">
            <el-input v-model="form.customer"/>
          </el-form-item>
          <el-form-item class="input" label="提货单号" prop="pickupOrder">
            <el-input v-model="form.pickupOrder"/>
          </el-form-item>
          <el-form-item class="input" label="运单号" prop="waybillNumber">
            <el-input v-model="form.waybillNumber"/>
          </el-form-item>
          <el-form-item class="input" label="订单号" prop="orderNumber">
            <el-input v-model="form.orderNumber"/>
          </el-form-item>
          <el-form-item class="input" label="始发地" prop="departureLocation">
            <el-input v-model="form.departureLocation"/>
          </el-form-item>
          <el-form-item class="input" label="目的地" prop="destination">
          <el-input v-model="form.destination"/>
        </el-form-item>
          <el-form-item class="input" label="提货地址" prop="departureLocation">
          <el-input v-model="form.departureLocation"/>
        </el-form-item>
          <el-form-item class="input" label="收货地址" prop="receivingAddress">
            <el-input v-model="form.receivingAddress"/>
          </el-form-item>
          <el-form-item class="input" label="提货司机" prop="driver">
            <el-input v-model="form.driver"/>
          </el-form-item>
          <el-form-item class="input" label="车牌号" prop="licensePlate">
            <el-input v-model="form.licensePlate"/>
          </el-form-item>
          <el-form-item class="input" label="手机号码" prop="phoneNumber">
            <el-input v-model="form.phoneNumber"/>
          </el-form-item>
          <el-form-item label="提货开始时间">
            <el-date-picker
              v-model="form.pickupStartTime"
              placeholder="选择日期"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss">
            </el-date-picker>
          </el-form-item><br>
          <el-form-item label="提货完成时间">
            <el-date-picker
              v-model="form.pickupCompleteTime"
              placeholder="选择日期"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="计划发车时间">
            <el-date-picker
              v-model="form.plannedDepartureTime"
              placeholder="选择日期"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="实际发车时间">
            <el-date-picker
              v-model="form.actualDepartureTime"
              placeholder="选择日期"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="计划到达时间">
            <el-date-picker
              v-model="form.plannedArrivalTime"
              placeholder="选择日期"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="实际到达时间">
            <el-date-picker
              v-model="form.actualArrivalTime"
              placeholder="选择日期"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss">
            </el-date-picker>
          </el-form-item>
        </el-form>
          </div>
        </div>


    <div class="c" style="margin: auto; margin-top: 20px; border-radius:5px; padding: 20px; width: 80%;  background: #FFFFFF;">
      <h3>货物信息</h3>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          prop="id"
          label="序号">
        </el-table-column>
        <el-table-column
          prop="departure"
          label="始发地">
        </el-table-column>
        <el-table-column
          prop="destination"
          label="目的地">
        </el-table-column>
        <el-table-column
          prop="name"
          label="货物名称">
        </el-table-column>
        <el-table-column
          prop="num"
          label="数量">
        </el-table-column>
        <el-table-column
          prop="tj"
          label="体积(m3)">
        </el-table-column>
        <el-table-column
          prop="zl"
          label="重量(kg)">
        </el-table-column>
        <el-table-column
          prop="fentan"
          label="分摊运费(元)">
        </el-table-column>
        <el-table-column
          prop="zxf"
          label="装卸费(元)">
        </el-table-column>
        <el-table-column
          prop="bzf"
          label="包装费(元)">
        </el-table-column>
      </el-table>
<!--      <el-form ref="form" :model="form" inline label-width="100px">-->
<!--        <el-form-item label="总数量">-->
<!--          <el-input v-model="form.carrier" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="总体积">-->
<!--          <el-input v-model="form.driver" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="总重量">-->
<!--          <el-input v-model="form.zzl" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="计费方式">-->
<!--          <el-input v-model="form.billingMethod" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="运费成本">-->
<!--          <el-input v-model="form.yfcb" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="包装费">-->
<!--          <el-input v-model="form.bzf" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="装卸费">-->
<!--          <el-input v-model="form.zxf" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="其他费用">-->
<!--          <el-input v-model="form.qtfy" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="运费合集">-->
<!--          <el-input v-model="form.yfhj" placeholder="请输入内容"/>-->
<!--        </el-form-item>-->
<!--      </el-form>-->
    </div>

  </div>



</template>
<script>
import { listOperation, getOperation, delOperation, addOperation, updateOperation } from "@/api/operation/operation";
import {addGoods} from "@/api/goods/goods";
import {addDraw, getDraw} from "@/api/draw/draw";

export default {
  data() {
    return {
      form: {},
      tableData: [
        {
          id: 1,
          departure: '河南',
          destination: '上海',
          name: '懒洋洋动力饮料',
          num: 10,
          tj: 0.0672,
          zl: 5.28,
          fentan: 500,
          zxf: 200,
          bzf: 200
        },
        {
          id: 2,
          departure: '北京',
          destination: '广州',
          name: '美洋洋动力饮料',
          num: 10,
          tj: 0.0672,
          zl: 5.28,
          fentan: 500,
          zxf: 200,
          bzf: 200
        },
      ],
    }
  },
  methods: {

    handleChange(value) {
      console.log(value);
    },
    findGoods() {
      var id = this.$route.query.id;
      getDraw(id).then(response => {
        console.log(response);
        this.form = response.data;
      });
    },
    onSubmit() {
      addDraw(this.form).then(response => {
        this.$modal.msgSuccess("成功");
      });
      this.$router.push({path: '/operation/operation'});
    },
    huowu(){

    }

  },
  created() {

    this.findGoods();
    console.log( this.$route.query.id+"....."+(this.$route.query.id!==undefined))
    if(this.$route.query.id!==undefined){
      this.findGoods();
    }
  },
}


</script>















